/*
 * @Author: mikey.zhaopeng 
 * @Date: 2018-12-30 10:20:14 
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-01-09 22:11:40
 */
import 'package:flutter/material.dart';
import '../widgets/game_type.dart' show GameType;

class GamePage extends StatefulWidget {
  @override
  _GamePageState createState() => _GamePageState();
}

class _GamePageState extends State<GamePage>
    with SingleTickerProviderStateMixin {
  TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = new TabController(vsync: this, length: 6);
  }

  @override
  void dispose() {
    _tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('游戏'),
        elevation: 0,
        backgroundColor: Colors.white,
      ),
      body: Column(
        children: <Widget>[
          Container(
            decoration: BoxDecoration(
              color: Colors.white,
              border: Border(
                bottom: BorderSide(
                  width: 1,
                  color: Color(0xffeeeeee),
                ),
              ),
            ),
            child: TabBar(
              controller: _tabController,
              labelColor: Color(0xfffe5ba8),
              labelStyle:
                  TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
              unselectedLabelColor: Color(0xff333333),
              unselectedLabelStyle: TextStyle(
                  fontWeight: FontWeight.normal, color: Color(0xff333333)),
              tabs: [
                new Tab(text: "热门"),
                new Tab(text: "题材"),
                new Tab(text: '画风'),
                new Tab(text: "风格"),
                new Tab(text: "玩法"),
                new Tab(text: "类型"),
              ],
              indicatorColor: Color(0xfffe5ba8),
              indicatorSize: TabBarIndicatorSize.label,
            ),
          ),
          Expanded(
            flex: 1,
            child: Container(
              color: Colors.white,
              child: TabBarView(
                controller: _tabController,
                children: [
                  GameType(),
                  Text("2"),
                  Text("3"),
                  Text("4"),
                  Text("5"),
                  Text("6"),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
